package com.dxy.test;

import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

public class demo {
    @Test
    public void test3(){
        DriverManagerDataSource ds=new DriverManagerDataSource();
        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setUrl("jdbc:mysql://localhost:3306/db9");
        ds.setUsername("root");
        ds.setPassword("123");
        JdbcTemplate jt=new JdbcTemplate();
        jt.setDataSource(ds);
        jt.update("insert into account2(name,money)values(?,?)","傻狗",250f);

    }
}
